import request from '@/utils/request'

export function getRoleList(data) {
  return request({
    url: '/sys/role/list',
    method: 'GET',
    params: data
  })
}
export const deleteRole = (data) => {
  return request({
    url: '/sys/role/delete',
    method: 'POST',
    data
  })
}
export const addRole = (data) => {
  return request({
    url: '/sys/role/add',
    method: 'POST',
    data
  })
}
export const updateRole = (data) => {
  return request({
    url: '/sys/role/update',
    method: 'POST',
    data
  })
}
// 分配权限
export const roleUpdateMenu = (data) => {
  return request({
    url: '/sys/role/updatemenu',
    method: 'POST',
    data: data
  })
}

export const roleMenu = (data) => {
  return request({
    url: '/sys/role/rolemenu',
    method: 'GET',
    params: data
  })
}
